#include "zrpc/base/logger.h"
#include "zrpc/rpc/rpc_server.h"
#include "sudoku.pb.h"

class SudokuServiceImpl : public ::sudoku::SudokuService {
 public:
  virtual void Solve(::google::protobuf::RpcController* controller,
                     const ::sudoku::SudokuRequest* request,
                     ::sudoku::SudokuResponse* response,
                     ::google::protobuf::Closure* done) {
    LOG_INFO << "";
    response->set_solved(true);
    response->set_checkerboard("1234567");
    done->Run();
  }
};

int main() {
  SudokuServiceImpl impl;
  zrpc::EventLoop loop;
  zrpc::RpcServer server(&loop, "127.0.0.1", 6379);
  server.RegisterService(&impl);
  server.Start();
  loop.Run();
  google::protobuf::ShutdownProtobufLibrary();
}